/**
 * Copyright (c) Daniel Centore
 *
 * ex: set filetype=java expandtab tabstop=4 shiftwidth=4 :
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of
 * the License, or (at your option) any later version.
 *
 * This code is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * This code is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published
 * by the Free Software Foundation.
 */
package ronp.anim.data.objects;

import java.awt.Graphics2D;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import ronp.anim.data.Grip;

/**
 * Represents a single object which can be drawn on the screen
 * 
 * @author Daniel Centore
 *
 */
public abstract class RNObject implements Serializable
{
	private static final long serialVersionUID = 1L;

	private List<Grip> grips = new ArrayList<Grip>(); // A list of all grips in use by this object (mandatory!)

	/**
	 * Draws the object
	 * @param activeFrame The frame of the object to display
	 * @param g The {@link Graphics2D} instance to draw on
	 */
	public abstract void drawImage(int activeFrame, Graphics2D g, boolean selected);

	/**
	 * @return A {@link List} of all {@link Grip}s in use by this {@link RNObject}.
	 */
	public List<Grip> getGrips()
	{
		return grips;
	}

	/**
	 * Adds {@link Grip}s to the list of used {@link Grip}s.
	 * @param g The {@link Grip}s to add.
	 */
	public void addGrips(Grip... g)
	{
		for (Grip k : g)
			grips.add(k);
	}

}
